<script>
    var lastSelectedRobot = sessionStorage.getItem("apt_AT_LastSelectedRobot");
    var appname = sessionStorage.getItem("apt_appName");

    if(lastSelectedRobot == null){
        var robots = sessionStorage.getItem("apt_Common.AvailableRobotsWithProcess");
        var lastSelectedRobot = robots.split('|')[0];
        sessionStorage.setItem("apt_AT_LastSelectedRobot", lastSelectedRobot);
    }

    var robotProcess = sessionStorage.getItem("apt_" + lastSelectedRobot + ".Process");
    var robotProcessDetails = sessionStorage.getItem("apt_" + lastSelectedRobot + ".ProcessDetails");


    var processToDisplay = sessionStorage.getItem("apt_AT_" + robotProcess + '.' + robotProcessDetails);
    if(processToDisplay == null){
        processToDisplay = "PMR/Overview.htm";
    }
    sessionStorage.setItem("apt_currentProccesSchemePath", processToDisplay.split("/")[0]);


    console.log({
        lastRob: lastSelectedRobot,
        robProcess: robotProcess,
        details: robotProcessDetails,
        display: processToDisplay
    });

    window.location.href = processToDisplay + "?app=" + appname + '&rob=' + lastSelectedRobot;
</script>